package com.sq.partner.manager.util;

import javax.servlet.ServletContext;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

@Component("initListener")
public class InitListener implements ServletContextAware, ApplicationListener<ContextRefreshedEvent> {

	private ServletContext servletContext;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		
		FreeMarkerUtil.init(servletContext);
	}

	@Override
	public void setServletContext(ServletContext servletContext) {
		this.servletContext=servletContext;
		
	}

}
